package servlet.cookie;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;


public class RemoveDateCookieServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
  
    public RemoveDateCookieServlet() {
     
    }


	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		doPost(request,response);
	}

	
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		//dayTime 쿠키 제거
		Cookie c = new Cookie("dayTime","");
		//쿠키 삭제 - setMaxAge(0);
		c.setMaxAge(0);
		response.addCookie(c);
		
		response.sendRedirect("/myservlet/cookie/get_cookie.html");
	}

}
